TOP; WC/ WORD COUNTER TEST PROGRAM CORRUPTED FROM W. A. GALE

 PARAMETER KLF=010
 PARAMETER KNL=013
 BYTE LF
 BYTE C0
 INT I00
 BYTE C1
 BYTE WB
 BYTE WT
 BYTE NL
 BYTE AA
 BYTE BB
 BYTE CC
 BYTE WW
 BYTE F1(00275)
 INT IBY
 INT ILN
 INT IWD
 INT IBR
 BYTE TR
 INT I10
 BYTE ND
 BYTE DS(010)
 BYTE CZ
 INT IYY
 INT IAA
 INT IBB
 INT IXX
 BEGINMAIN(AC,IAV)
 C0=+000
 C1=+001
 NL=+KNL
 LF=+KLF
 WB=' '
 WT=+009
 IBY=+00000
 IWD=+00000
 ILN=+00000
 CZ='0'
 WW=+000
 I10=+00010
 I00=+00000
 TR='R'
 IBR=+00001
 CLOSE F1
 ASSOCIATE FCB 1 WITH IBR
 OPEN F1 FOR TR AT IBR
 WHILE
	READ CC FROM F1
	AA=ER==C0
 ON AA
	IBY++
	AA=CC==WB
	BB=CC==WT
	AA=AA?BB
	BB=CC==NL
	IF BB
		ILN++
	ENDIF
	AA=AA?BB
	IF AA
		WW=+000
	ELSE
		AA=WW==C0
		IF AA
			IWD++
			WW=+001
		ENDIF
	ENDIF
 ENDWHILE
 IAA=ER
 GOSUB PN
 IAA=ILN
 GOSUB PN
 IAA=IWD
 GOSUB PN
 IAA=IBY
 GOSUB PN
 WRITE NL
 WRITE LF
 CLOSE F1
 ENDMAIN
 SUB PN
 AA=IAA==I00
 IF AA
	ND=C1
	DS(C0)=CZ
 ELSE
	ND=C0
	WHILE
		AA=I00<!IAA
	ON AA
		IYY=IAA/I10
		IBB=I10*IYY
		IXX=IAA-IBB
		IAA=IYY
		AA=IXX
		AA=AA+CZ
		DS(ND)=AA
		ND++
	ENDWHILE
 ENDIF
 WHILE
	IBB=ND
	AA=I00<!IBB
 ON AA
	ND--
	AA=DS(ND)
	WRITE AA
 ENDWHILE
 WRITE WB
 ENDSUB
 BOTTOM

   
